package com.heima.media.config;

import com.heima.media.interceptor.UserInterceptor;
import org.springframework.stereotype.Service;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Service
public class WebConfig implements WebMvcConfigurer {
    /*
        配置拦截器  使之生效
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new UserInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/login/in");
    }
}
